﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using tinyweb.framework;

namespace Bepo.Helpers
{
    public class Success
    {
        public string status { get; set; }
        public object data { get; set; }
    }

    public class Fail
    {
        public string status { get; set; }
        public string message { get; set; }
    }

    public class None
    {
        public string status { get; set; }
    }

    public static class Envelope
    {
        public static IResult Json(object o)
        {
            return Result.Json(new Success { status = "success", data = o });
        }

        public static IResult None()
        {
            return Result.Json(new None { status = "success" });
        }

        public static IResult Error(string message)
        {
            return Result.Json(new Fail { status = "error", message = message });
        }
    }
}